package com.sfddata.musicpillow.oauth.feign;

import com.sfddata.musicpillow.oauth.entity.AuthToken;
import com.sfddata.musicpillow.oauth.entity.CheckToken;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;


@FeignClient("mp-oauth-server")
public interface OauthFeignService {

    @PostMapping("/oauth/token")
    AuthToken getToken(@RequestParam("username")String phone,
                       @RequestParam("password")String password,
                       @RequestParam("client_id")String cid,
                       @RequestParam("client_secret")String cs,
                       @RequestParam("grant_type")String gt);

    @PostMapping("/oauth/check_token")
    CheckToken checkToken(@RequestParam("token")String token);


}
